package com.hs.util;

import android.content.Context;

public class DisplayUtil
{
	public static final float dipTopx(Context context, float dip)
    {
        final float GESTURE_THRESHOLD_DIP = 160.0f;
        float densityDpi = context.getResources().getDisplayMetrics().densityDpi;
        
        return dip * densityDpi / GESTURE_THRESHOLD_DIP;
    }
    
    public static final float pxTodip(Context context, float px)
    {
        final float GESTURE_THRESHOLD_DIP = 160.0f;
        float densityDpi = context.getResources().getDisplayMetrics().densityDpi;
        
        return px * GESTURE_THRESHOLD_DIP / densityDpi;
    }
}
